import globals from 'globals'
import pluginVue from 'eslint-plugin-vue'

import path from 'path'
import { fileURLToPath } from 'url'
import { FlatCompat } from '@eslint/eslintrc'
import pluginJs from '@eslint/js'

// mimic CommonJS variables -- not needed if using CommonJS
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({ baseDirectory: __dirname, recommendedConfig: pluginJs.configs.recommended })

export default [
  { languageOptions: { globals: { ...globals.browser, ...globals.node } } },
  ...compat.extends('standard'),
  ...pluginVue.configs['flat/strongly-recommended'],
  ...compat.config({
    extends: './.eslintrc-auto-import.json',
    rules: {
      'vue/multi-word-component-names': 'off',
      camelcase: 'off',
      'vue/no-mutating-props': 'off',
      'vue/no-deprecated-filter': 'off',
      'vue/no-side-effects-in-computed-properties': 'off',
      'no-unused-vars': 'off',
      'unicode-bom': 'off',
      'no-useless-escape': 'off',
      'vue/valid-define-emits': 'off',
      'array-callback-return': 'off',
      'prefer-promise-reject-errors': 'off',
      'vue/no-dupe-keys': 'off',
      'vue/require-valid-default-prop': 'off',
      'no-labels': 'off',
      eqeqeq: 'off'
    }
  })
]
